2b54e904585d8635979c050216712ca9ba2f0096,advanced/server/src/functionaltest/java/org/neo4j/server/rest/PathsFunctionalTest.java,PathsFunctionalTest,shouldGetCorrectDijkstraPathsWithWeightsWithDefaultCost,#,216

Before Change


    public void shouldGetCorrectDijkstraPathsWithWeightsWithDefaultCost() throws Exception
    {
        long[] nodes = createDijkstraGraph( false );
        Client client = Client.create();

        // Get cheapest paths using Dijkstra
        WebResource resource = client.resource( functionalTestHelper.nodeUri(nodes[ 0 ]) + "/path" );
        ClientResponse response = resource.type( MediaType.APPLICATION_JSON ).accept(
                MediaType.APPLICATION_JSON ).entity( getAllPathsUsingDijkstraPayLoad( nodes[1], true ) ).post( ClientResponse.class );
        assertEquals( 200, response.getStatus() );
        Map<?, ?> path = (Map<?, ?>)JsonHelper.jsonToMap( response.getEntity( String.class ) );
        assertTrue( path.get( "start" ).toString().endsWith( "/node/" + nodes[ 0 ] ) );
        assertTrue( path.get( "end" ).toString().endsWith( "/node/" + nodes[ 1 ] ) );
        assertEquals( 6, path.get( "length" ) );

After Change


    @Test
    public void shouldGetCorrectDijkstraPathsWithWeightsWithDefaultCost() throws Exception
    {
        long[] nodes = createDijkstraGraph( false );

        // Get cheapest paths using Dijkstra
        ClientResponse response = postPathQuery( nodes, getAllPathsUsingDijkstraPayLoad( nodes[ 1 ], true ), "/path" );


        Map<?, ?> path = JsonHelper.jsonToMap( response.getEntity( String.class ) );
        assertTrue( path.get( "start" ).toString().endsWith( "/node/" + nodes[ 0 ] ) );
        assertTrue( path.get( "end" ).toString().endsWith( "/node/" + nodes[ 1 ] ) );
        assertEquals( 6, path.get( "length" ) );